package com.kingsalert.kingsalert.analytics.util

import android.app.Application
import com.kingsalert.kingsalert.analytics.data_sdk.ASBuilder
import com.kingsalert.kingsalert.analytics.data_sdk.ASSycManager
import com.kingsalert.kingsalert.util.UserInfoUtil

object SycDeviceUtil {

    /**
     * 初始化设备信息模块
     *
     * @param context Application
     */
    fun init(context: Application) {
        try {

            ASBuilder.setLog(false)
            // 初始化
            ASSycManager.getInstance().init(context)

        } catch (e: Exception) {
            e.printStackTrace()
        }
    }

    /**
     * 保存设备 s2s信息
     */
    fun saveS2SInfo() {
        try {
            if (UserInfoUtil.getInstance().didLogin()) {
                ASSycManager.getInstance().sycData {}
            }
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }
}